/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.capex.farmacus.encapsulates;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author IK
 */
@Entity
@Table(name = "supervisores")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Supervisores.findAll", query = "SELECT s FROM Supervisores s"),
    @NamedQuery(name = "Supervisores.findByIdsupervisores", query = "SELECT s FROM Supervisores s WHERE s.idsupervisores = :idsupervisores"),
    @NamedQuery(name = "Supervisores.findByNombresupervisores", query = "SELECT s FROM Supervisores s WHERE s.nombresupervisores = :nombresupervisores"),
    @NamedQuery(name = "Supervisores.findByCedulaSupervisores", query = "SELECT s FROM Supervisores s WHERE s.cedulaSupervisores = :cedulaSupervisores"),
    @NamedQuery(name = "Supervisores.findByTelefonoSupervisor", query = "SELECT s FROM Supervisores s WHERE s.telefonoSupervisor = :telefonoSupervisor"),
    @NamedQuery(name = "Supervisores.findByCorreoSup", query = "SELECT s FROM Supervisores s WHERE s.correoSup = :correoSup")})
public class Supervisores implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idsupervisores")
    private Integer idsupervisores;
    @Column(name = "Nombre_supervisores")
    private String nombresupervisores;
    @Column(name = "cedula_supervisores")
    private String cedulaSupervisores;
    @Column(name = "telefono_supervisor")
    private String telefonoSupervisor;
    @Column(name = "correo_sup")
    private String correoSup;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "supervisores")
    private Vendedores vendedores;
    @OneToMany(mappedBy = "idSupervisor")
    private List<Autenticacion> autenticacionList;

    public Supervisores() {
    }

    public Supervisores(Integer idsupervisores) {
        this.idsupervisores = idsupervisores;
    }

    public Integer getIdsupervisores() {
        return idsupervisores;
    }

    public void setIdsupervisores(Integer idsupervisores) {
        this.idsupervisores = idsupervisores;
    }

    public String getNombresupervisores() {
        return nombresupervisores;
    }

    public void setNombresupervisores(String nombresupervisores) {
        this.nombresupervisores = nombresupervisores;
    }

    public String getCedulaSupervisores() {
        return cedulaSupervisores;
    }

    public void setCedulaSupervisores(String cedulaSupervisores) {
        this.cedulaSupervisores = cedulaSupervisores;
    }

    public String getTelefonoSupervisor() {
        return telefonoSupervisor;
    }

    public void setTelefonoSupervisor(String telefonoSupervisor) {
        this.telefonoSupervisor = telefonoSupervisor;
    }

    public String getCorreoSup() {
        return correoSup;
    }

    public void setCorreoSup(String correoSup) {
        this.correoSup = correoSup;
    }

    public Vendedores getVendedores() {
        return vendedores;
    }

    public void setVendedores(Vendedores vendedores) {
        this.vendedores = vendedores;
    }

    @XmlTransient
    public List<Autenticacion> getAutenticacionList() {
        return autenticacionList;
    }

    public void setAutenticacionList(List<Autenticacion> autenticacionList) {
        this.autenticacionList = autenticacionList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idsupervisores != null ? idsupervisores.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Supervisores)) {
            return false;
        }
        Supervisores other = (Supervisores) object;
        if ((this.idsupervisores == null && other.idsupervisores != null) || (this.idsupervisores != null && !this.idsupervisores.equals(other.idsupervisores))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.capex.farmacus.encapsulates.Supervisores[ idsupervisores=" + idsupervisores + " ]";
    }
    
}
